Integrand size = 29, antiderivative size = 119 \[ \int \cos (c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=a^2 (3 A b+a B) x+\frac {b \left (6 a A b+6 a^2 B+b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a^2 (2 a A-b B) \sin (c+d x)}{2 d}+\frac {b B (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {b^2 (A b+2 a B) \tan (c+d x)}{d} \]
[Out]
Time = 0.25 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.10, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {4110, 4133, 3855, 3852, 8} \[ \int \cos (c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {b \left (6 a^2 B+6 a A b+b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 d}-\frac {b \left (2 a^2 A-3 a b B-A b^2\right ) \tan (c+d x)}{d}+a^2 x (a B+3 A b)-\frac {b^2 (2 a A-b B) \tan (c+d x) \sec (c+d x)}{2 d}+\frac {a A \sin (c+d x) (a+b \sec (c+d x))^2}{d} \]
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 4110
Rule 4133
Rubi steps \begin{align*} \text {integral}& = \frac {a A (a+b \sec (c+d x))^2 \sin (c+d x)}{d}-\int (a+b \sec (c+d x)) \left (-a (3 A b+a B)-b (A b+2 a B) \sec (c+d x)+b (2 a A-b B) \sec ^2(c+d x)\right ) \, dx \\ & = \frac {a A (a+b \sec (c+d x))^2 \sin (c+d x)}{d}-\frac {b^2 (2 a A-b B) \sec (c+d x) \tan (c+d x)}{2 d}-\frac {1}{2} \int \left (-2 a^2 (3 A b+a B)-b \left (6 a A b+6 a^2 B+b^2 B\right ) \sec (c+d x)+2 b \left (2 a^2 A-A b^2-3 a b B\right ) \sec ^2(c+d x)\right ) \, dx \\ & = a^2 (3 A b+a B) x+\frac {a A (a+b \sec (c+d x))^2 \sin (c+d x)}{d}-\frac {b^2 (2 a A-b B) \sec (c+d x) \tan (c+d x)}{2 d}-\left (b \left (2 a^2 A-A b^2-3 a b B\right )\right ) \int \sec ^2(c+d x) \, dx+\frac {1}{2} \left (b \left (6 a A b+6 a^2 B+b^2 B\right )\right ) \int \sec (c+d x) \, dx \\ & = a^2 (3 A b+a B) x+\frac {b \left (6 a A b+6 a^2 B+b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a A (a+b \sec (c+d x))^2 \sin (c+d x)}{d}-\frac {b^2 (2 a A-b B) \sec (c+d x) \tan (c+d x)}{2 d}+\frac {\left (b \left (2 a^2 A-A b^2-3 a b B\right )\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{d} \\ & = a^2 (3 A b+a B) x+\frac {b \left (6 a A b+6 a^2 B+b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a A (a+b \sec (c+d x))^2 \sin (c+d x)}{d}-\frac {b \left (2 a^2 A-A b^2-3 a b B\right ) \tan (c+d x)}{d}-\frac {b^2 (2 a A-b B) \sec (c+d x) \tan (c+d x)}{2 d} \\ \end{align*}
Time = 0.92 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.88 \[ \int \cos (c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {6 a^2 A b d x+2 a^3 B d x+b \left (6 a A b+6 a^2 B+b^2 B\right ) \text {arctanh}(\sin (c+d x))+2 a^3 A \sin (c+d x)+2 A b^3 \tan (c+d x)+6 a b^2 B \tan (c+d x)+b^3 B \sec (c+d x) \tan (c+d x)}{2 d} \]
[In]
[Out]
Time = 2.87 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.18
method | result | size |
derivativedivides | \(\frac {A \,a^{3} \sin \left (d x +c \right )+B \,a^{3} \left (d x +c \right )+3 A \,a^{2} b \left (d x +c \right )+3 B \,a^{2} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 A a \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 B \tan \left (d x +c \right ) a \,b^{2}+A \tan \left (d x +c \right ) b^{3}+B \,b^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(141\) |
default | \(\frac {A \,a^{3} \sin \left (d x +c \right )+B \,a^{3} \left (d x +c \right )+3 A \,a^{2} b \left (d x +c \right )+3 B \,a^{2} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 A a \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 B \tan \left (d x +c \right ) a \,b^{2}+A \tan \left (d x +c \right ) b^{3}+B \,b^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(141\) |
parallelrisch | \(\frac {-6 b \left (1+\cos \left (2 d x +2 c \right )\right ) \left (A a b +B \,a^{2}+\frac {1}{6} b^{2} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+6 b \left (1+\cos \left (2 d x +2 c \right )\right ) \left (A a b +B \,a^{2}+\frac {1}{6} b^{2} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+6 \left (A b +\frac {B a}{3}\right ) d x \,a^{2} \cos \left (2 d x +2 c \right )+\left (2 A \,b^{3}+6 B a \,b^{2}\right ) \sin \left (2 d x +2 c \right )+a^{3} A \sin \left (3 d x +3 c \right )+\left (a^{3} A +2 B \,b^{3}\right ) \sin \left (d x +c \right )+6 \left (A b +\frac {B a}{3}\right ) d x \,a^{2}}{2 d \left (1+\cos \left (2 d x +2 c \right )\right )}\) | \(200\) |
risch | \(3 A \,a^{2} b x +a^{3} x B -\frac {i a^{3} A \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a^{3} A \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}-\frac {i b^{2} \left (B b \,{\mathrm e}^{3 i \left (d x +c \right )}-2 A b \,{\mathrm e}^{2 i \left (d x +c \right )}-6 B a \,{\mathrm e}^{2 i \left (d x +c \right )}-B b \,{\mathrm e}^{i \left (d x +c \right )}-2 A b -6 B a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A a \,b^{2}}{d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B \,a^{2} b}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B \,b^{3}}{2 d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A a \,b^{2}}{d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B \,a^{2} b}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B \,b^{3}}{2 d}\) | \(272\) |
norman | \(\frac {\left (-3 A \,a^{2} b -B \,a^{3}\right ) x +\left (-6 A \,a^{2} b -2 B \,a^{3}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (3 A \,a^{2} b +B \,a^{3}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (6 A \,a^{2} b +2 B \,a^{3}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\frac {\left (2 a^{3} A -2 A \,b^{3}-6 B a \,b^{2}+B \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}+\frac {\left (6 a^{3} A +2 A \,b^{3}+6 B a \,b^{2}-B \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}-\frac {\left (2 a^{3} A +2 A \,b^{3}+6 B a \,b^{2}+B \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {\left (6 a^{3} A -2 A \,b^{3}-6 B a \,b^{2}-B \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right ) \left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}-\frac {b \left (6 A a b +6 B \,a^{2}+b^{2} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {b \left (6 A a b +6 B \,a^{2}+b^{2} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(362\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.40 \[ \int \cos (c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {4 \, {\left (B a^{3} + 3 \, A a^{2} b\right )} d x \cos \left (d x + c\right )^{2} + {\left (6 \, B a^{2} b + 6 \, A a b^{2} + B b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (6 \, B a^{2} b + 6 \, A a b^{2} + B b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, A a^{3} \cos \left (d x + c\right )^{2} + B b^{3} + 2 \, {\left (3 \, B a b^{2} + A b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \]
[In]
[Out]
\[ \int \cos (c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\int \left (A + B \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{3} \cos {\left (c + d x \right )}\, dx \]
[In]
[Out]
none
Time = 0.22 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.42 \[ \int \cos (c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {4 \, {\left (d x + c\right )} B a^{3} + 12 \, {\left (d x + c\right )} A a^{2} b - B b^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, B a^{2} b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, A a b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, A a^{3} \sin \left (d x + c\right ) + 12 \, B a b^{2} \tan \left (d x + c\right ) + 4 \, A b^{3} \tan \left (d x + c\right )}{4 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 241 vs. \(2 (113) = 226\).
Time = 0.35 (sec) , antiderivative size = 241, normalized size of antiderivative = 2.03 \[ \int \cos (c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {\frac {4 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} + 2 \, {\left (B a^{3} + 3 \, A a^{2} b\right )} {\left (d x + c\right )} + {\left (6 \, B a^{2} b + 6 \, A a b^{2} + B b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (6 \, B a^{2} b + 6 \, A a b^{2} + B b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (6 \, B a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, A b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - B b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, B a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, A b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - B b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \]
[In]
[Out]
Time = 15.64 (sec) , antiderivative size = 249, normalized size of antiderivative = 2.09 \[ \int \cos (c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {\frac {A\,a^3\,\sin \left (3\,c+3\,d\,x\right )}{4}+\frac {A\,b^3\,\sin \left (2\,c+2\,d\,x\right )}{2}+\frac {A\,a^3\,\sin \left (c+d\,x\right )}{4}+\frac {B\,b^3\,\sin \left (c+d\,x\right )}{2}+\frac {3\,B\,a\,b^2\,\sin \left (2\,c+2\,d\,x\right )}{2}}{d\,\left (\frac {\cos \left (2\,c+2\,d\,x\right )}{2}+\frac {1}{2}\right )}-\frac {2\,\left (-B\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+\frac {B\,b^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,1{}\mathrm {i}}{2}-3\,A\,a^2\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+A\,a\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,3{}\mathrm {i}+B\,a^2\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,3{}\mathrm {i}\right )}{d} \]
[In]
[Out]